﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace MvcCmsSocial
{
    public class Routes : AreaRegistration
    {
        public override string AreaName
        {
            get { return "MvcCmsSocial"; }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            var routes = context.Routes;
            //probaby want to standardize all these to one beginning
            //name so not so many possible routes are taken up.
            routes.MapRoute(
                "SocialDefault",
                "social",
                new { controller = "MvcCmsSocial", action = "Index" }
                ).DataTokens = new RouteValueDictionary(new { area = AreaName });

            routes.MapRoute(
                "SocialProfile",
                "social/profiles/{userName}/{page}",
                new { controller = "MvcCmsSocial", action = "ViewProfile", page="1" }
                ).DataTokens = new RouteValueDictionary(new { area = AreaName });

            routes.MapRoute(
                "SocialEditProfile",
                "social/edit-profile",
                new { controller = "MvcCmsSocial", action = "EditProfile" }
                ).DataTokens = new RouteValueDictionary(new { area = AreaName });

            routes.MapRoute(
                "SocialEditAboutMe",
                "social/edit-aboutme",
                new { controller = "MvcCmsSocial", action = "EditAboutMe" }
                ).DataTokens = new RouteValueDictionary(new { area = AreaName });

            routes.MapRoute(
                "SocialWall",
                "social/wall/{userID}/{page}",
                new { controller = "MvcCmsSocial", action = "Wall", page="1" }
                ).DataTokens = new RouteValueDictionary(new { area = AreaName });

            routes.MapRoute(
                "SocialInfo",
                "social/info/{userID}",
                new { controller = "MvcCmsSocial", action = "Info" }
                ).DataTokens = new RouteValueDictionary(new { area = AreaName });

            routes.MapRoute(
                "SocialAjax",
                "socialajax/{action}",
                new { controller = "MvcCmsSocialAjax" }
                ).DataTokens = new RouteValueDictionary(new { area = AreaName });

            routes.MapRoute(
                "SocialPhotos",
                "social/photos/{userID}",
                new { controller = "MvcCmsSocial", action = "Photos" }
                ).DataTokens = new RouteValueDictionary(new { area = AreaName });

        }
    }

}
